#!/bin/bash

# 服务名称
SERVICE_NAME="text-sync"

# 停止服务
sudo systemctl stop $SERVICE_NAME

# 禁用服务开机启动
sudo systemctl disable $SERVICE_NAME

# 删除 systemd 服务文件
SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service"
if [ -f "$SERVICE_FILE" ]; then
    sudo rm $SERVICE_FILE
fi

# 重新加载 systemd
sudo systemctl daemon-reload

echo "Service $SERVICE_NAME stopped and uninstalled successfully."
